use [MVPNorthwind]

PRINT 'Creating Procedure - TenMostExpensiveProducts'
GO
create procedure TenMostExpensiveProducts AS
SET ROWCOUNT 10
SELECT Products.ProductName AS TenMostExpensiveProducts, Products.UnitPrice
FROM Products
ORDER BY Products.UnitPrice DESC
GO

PRINT 'Creating Procedure - EmployeeSalesByCountry'
GO
create procedure EmployeeSalesByCountry
@Beginning_Date DateTime, @Ending_Date DateTime AS
SELECT Employees.Country, Employees.LastName, Employees.FirstName, Orders.ShippedDate, Orders.OrderID, OrderSubtotals.Subtotal AS SaleAmount
FROM Employees INNER JOIN 
	(Orders INNER JOIN OrderSubtotals ON Orders.OrderID = OrderSubtotals.OrderID) 
	ON Employees.EmployeeID = Orders.EmployeeID
WHERE Orders.ShippedDate Between @Beginning_Date And @Ending_Date
GO

PRINT 'Creating Procedure - EmployeeSalesByCountry'
GO
create procedure SalesByYear
	@Beginning_Date DateTime, @Ending_Date DateTime AS
SELECT Orders.ShippedDate, Orders.OrderID, OrderSubtotals.Subtotal, DATENAME(yy,ShippedDate) AS Year
FROM Orders INNER JOIN OrderSubtotals ON Orders.OrderID = OrderSubtotals.OrderID
WHERE Orders.ShippedDate Between @Beginning_Date And @Ending_Date
GO